﻿using System;
using System.Text;

namespace ParkingDataSimulate
{
    class Program111
    {
        static void Main111(string[] args)
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

            var timeZone = TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
            var TimeZoneList = TimeZoneInfo.GetSystemTimeZones();
            string utc = $"{DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} {TimeZoneList[0].BaseUtcOffset}";
            Console.WriteLine($"Hello World! {DateTime.Now:f}  [{utc}] [{timeZone.BaseUtcOffset}]");

            Console.WriteLine("--------------------------------------------------");

            //Console.WriteLine("INPUT STAY HOURS (5)........");
            //string houtrs = Console.ReadLine();
            //int IntervalHours = int.Parse(houtrs); 
            //ScheduleParents.IntervalHours = IntervalHours; ;
            //ScheduleParents.NumberPlate = string.Empty;
            //ScheduleParents.RunSecondlyGlobalProgram(IntervalHours).GetAwaiter();

            int IntervalSeconds = 20;
            ParkingDataSimulateTask.Stop = false;
            ParkingDataSimulateTask.IntervalSeconds = IntervalSeconds; ;

#if DEBUG

            Console.WriteLine("INPUT NUMBER PLATE TO CONTINUE,INPUT 1 TO SKIP.....");

            string numberPlate1 = Console.ReadLine();

            while (true)
            {
                if (!string.IsNullOrEmpty(numberPlate1))
                    break;

                Console.WriteLine("INPUT NUMBER PLATE TO CONTINUE,INPUT 1 TO SKIP.....");

                numberPlate1 = Console.ReadLine();
            }

            if (numberPlate1.Equals("1"))
            {
                numberPlate1 = string.Empty;
            }

            ParkingDataSimulateTask.NumberPlate = numberPlate1;
#endif

            ParkingDataSimulateTask.RunSecondlyGlobalProgram(IntervalSeconds).GetAwaiter(); ;

             
            Console.WriteLine("--------------------------------------------------");
            Console.ReadKey();
            Console.ReadKey();
            Console.WriteLine("PRESS ANY KEY  TO EXIT....");
            Console.ReadKey();
        }
    }
}
